import Ember from 'ember';
import {
  selectedStatus
}
from '../../../utils/mlist-util';
import {
  module, test
}
from 'qunit';

module('Unit | Utility | mlist util');

// Replace this with your real tests.
test('it works', function(assert) {
  var selected = Ember.Object.create({
      isSelected: true
    }),
    unselected =
    Ember.Object.create({
      isSelected: false
    });

  var list = [selected, unselected];
  let result = selectedStatus(list);

  assert.ok(result.one, "only one is selected");
  assert.ok(result.some, "some include one");
  assert.notOk(result.all, "not all");
  assert.notOk(result.none, "not none");

  list = [];
  result = selectedStatus(list);
  assert.notOk(result.one, "no one is selected");
  assert.notOk(result.some, "no some is selected");
  assert.notOk(result.all, "not all");
  assert.ok(result.none, "is none");

  list = [selected, selected];
  result = selectedStatus(list);
  assert.notOk(result.one, "no one is selected");
  assert.ok(result.some, "some include all");
  assert.ok(result.all, "is all");
  assert.notOk(result.none, "not none");
});
